{include file="include/header" /}
{include file="include/topnav" /}
<div class="page-body">
    {include file="include/sider" /}
    <div class="page-main">
        <div class="panel panel-primary">
            <div class="panel-heading">{eq name="group.ag_id" value="0"}添加权限分组{else/}修改权限分组{/eq}</div>
            <div class="panel-body panel-form">
                <form action="{:url('save')}" class="form-horizontal" method="post">
                    {:token()}
                    <input type="hidden" name="gid" value="{$group.ag_id}">
                    <div class="form-group">
                        <label for="ag_name" class="col-sm-offset-1 col-sm-2 control-label">权限组名称：</label>
                        <div class="col-sm-8">
                            {gt name="group.ag_id" value="3"}
                            <input type="text" class="form-control" id="ag_name" name="ag_name" value="{$group.ag_name}" placeholder="请输入分组名称"> {else/} {eq name="group.ag_id" value="0"}
                            <input type="text" class="form-control" id="ag_name" name="ag_name" value="{$group.ag_name}" placeholder="请输入分组名称"> {else/}
                            <div class="input-group">
                                <input type="text" class="form-control disabled" name="ag_name" id="ag_name" value="{$group.ag_name}" placeholder="请输入分组名称">
                                <div class="input-group-btn">
                                    <button class="btn btn-danger disabled" type="button">系统内置，不允许修改</button>
                                </div>
                            </div>
                            {/eq} {/gt}
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="ag_login" class="col-sm-offset-1 col-sm-2 control-label">默认登陆地址：</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" id="ag_login" name="ag_login" value="{$group.ag_login}" placeholder="默认登陆地址，管理员后台请用 /Admin">
                        </div>
                    </div>
                    <!--权限列表开始-->
                    {volist name="authlist" id="module"}
                    <div class="form-group">
                        <label class="col-sm-offset-1 col-sm-2 control-label">{$module.am_name}：</label>
                        <div class="col-sm-8">
                            <div class="row">
                                {volist name="module.list" id="controller"}
                                    <div class="col-sm-6">
                                        <div class="panel panel-default controller">
                                            <div class="panel-heading">
                                                <b>{$controller.ac_name}</b>
                                            </div>
                                            <div class="panel-body">
                                                {volist name="controller.list" id="action"}
                                                <div class="checkbox action col-lg-4 col-md-6 col-sm-12 col-xs-6">
                                                    <label>
                                                        <input type="checkbox" name="ag_auth[]" value="{$action.aa_key}" {eq name="action.selected" value="1"}checked{/eq} > {$action.aa_name}
                                                    </label>
                                                </div>
                                                {/volist}
                                            </div>
                                        </div>
                                    </div>
                                {/volist}
                            </div>
                        </div>
                    </div>
                    {/volist}
                    <!--权限列表结束-->
                    <div class="form-group">
                        <label class="col-sm-offset-1 col-sm-2 control-label"></label>
                        <div class="col-sm-8">
                            <button type="submit" class="btn btn-danger">保存权限设置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{include file="include/footer" /}
